package com.component;

import javax.servlet.*;
import java.io.IOException;

//@WebFilter
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("MyFilter被初始化");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("MyFilter拦截被使用");
    }

    @Override
    public void destroy() {
        System.out.println("MyFilter被销毁");
    }
}
